Function at 0x402197
Capabilities:
Parse pe header
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7a4
mov eax, dword [0x41f024]
xor eax, esp
mov dword [esp + 0x7a0], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [esp + 0x1c], eax
xor eax, eax
xor ebx, ebx
push 0x206
mov word [esp + 0x1a4], ax
lea eax, [esp + 0x1a6]
push ebx
push eax
mov dword [esp + 0x20], ebx
call fcn.00409e10
add esp, 0xc
push 0x104
lea eax, [esp + 0x1a4]
push eax
push ebx
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x40220e
mov dword [esp + 0x14], 1
jmp 0x402449
push 0x41a3fc
lea eax, [esp + 0x1a4]
push eax
lea eax, [esp + 0x18]
push eax
call fcn.0040a2b6
add esp, 0xc
test eax, eax
je 0x402239
mov dword [esp + 0x14], 2
jmp 0x402449
xor eax, eax
push 0x3e
mov word [esp + 0x34], ax
lea eax, [esp + 0x36]
push ebx
push eax
call fcn.00409e10
push dword [esp + 0x1c]
lea eax, [esp + 0x40]
push 1
push 0x40
push eax
call fcn.0040a7eb
mov eax, 0x5a4d
add esp, 0x1c
cmp word [esp + 0x30], ax
je 0x40227b
mov dword [esp + 0x14], 3
jmp 0x402449
push ebx
push dword [esp + 0x70]
push dword [esp + 0x18]
call fcn.0040aa63
push 0xf4
lea eax, [esp + 0xac]
push ebx
push eax
mov dword [esp + 0xb0], ebx
call fcn.00409e10
push dword [esp + 0x28]
lea eax, [esp + 0xb4]
push 1
push 0xf8
push eax
call fcn.0040a7eb
add esp, 0x28
cmp dword [esp + 0x98], 0x4550
jne 0x40226e
movzx esi, word [esp + 0x9e]
cmp esi, ebx
jle 0x402349
push dword [esp + 0x10]
lea eax, [esp + 0x74]
push 1
push 0x28
push eax
call fcn.0040a7eb
xor eax, eax
mov byte [esp + 0x1a4], 0
lea edi, [esp + 0x1a5]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push 8
lea eax, [esp + 0x84]
push eax
lea eax, [esp + 0x1ac]
push eax
call fcn.0040a3c0
lea eax, [esp + 0x1b0]
push eax
push str.existed_section_name:_s_n
call fcn.0040a4e4
lea eax, [esp + 0x1b8]
push str..dypatch
push eax
call fcn.00416079
add esp, 0x2c
test eax, eax
je 0x402343
inc ebx
cmp ebx, esi
jl 0x4022d7
cmp ebx, esi
jl 0x402356
xor ebx, ebx
mov dword [esp + 0x14], 4
jmp 0x402449
push 0
push dword [esp + 0x88]
push dword [esp + 0x18]
call fcn.0040aa63
push dword [esp + 0x1c]
xor eax, eax
mov byte [esp + 0x30], 0
lea edi, [esp + 0x31]
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
xor eax, eax
lea edi, [esp + 0x38]
stosd dword es:[edi], eax
push 1
stosd dword es:[edi], eax
lea eax, [esp + 0x34]
push 0x10
push eax
call fcn.0040a7eb
push 8
lea eax, [esp + 0x40]
push str.DYUPD_01
push eax
call fcn.0040a2fd
add esp, 0x28
test eax, eax
jne 0x4023b1
mov edi, dword [esp + 0x28]
test edi, edi
jg 0x4023be
mov dword [esp + 0x14], 5
jmp 0x402447
mov esi, 0x400
mov ebx, edi
cmp edi, esi
jle 0x4023cb
mov edi, esi
push 0x41a420
push dword [esp + 0x20]
lea eax, [esp + 0x20]
push eax
call fcn.0040a2b6
add esp, 0xc
test eax, eax
je 0x4023ef
mov dword [esp + 0x14], 2
jmp 0x402447
test edi, edi
jle 0x40243b
push dword [esp + 0x10]
lea eax, [esp + 0x3ac]
push edi
push 1
push eax
call fcn.0040a7eb
add esp, 0x10
test eax, eax
je 0x40243b
mov ecx, ebx
sub ecx, eax
js 0x40243b
push dword [esp + 0x18]
push eax
lea eax, [esp + 0x3b0]
push 1
push eax
call fcn.0040a95f
sub ebx, eax
add esp, 0x10
cmp ebx, esi
jle 0x402435
mov edi, esi
jmp 0x4023f3
mov edi, ebx
test ebx, ebx
jg 0x4023f3
test ebx, ebx
je 0x402447
mov dword [esp + 0x14], 6
xor ebx, ebx
cmp dword [esp + 0x10], ebx
je 0x402459
push dword [esp + 0x10]
call fcn.0040ab4c
pop ecx
cmp dword [esp + 0x18], ebx
je 0x402469
push dword [esp + 0x18]
call fcn.0040ab4c
pop ecx
mov ecx, dword [esp + 0x7ac]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00409256
mov esp, ebp
pop ebp
ret