Function at 0x40bb50
Capabilities:
Get common file path
Get file size
Parse pe header
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x88
mov eax, dword [0x42610c]
xor eax, esp
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x94]
push ebx
push ebp
mov ebp, dword [esp + 0x94]
push esi
mov esi, dword [esp + 0xac]
push edi
mov edi, dword [esp + 0xa0]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0xac]
xor ebx, ebx
push 0x5c
push edi
mov dword [esp + 0x18], ebp
mov dword [esp + 0x2c], eax
mov dword [0x429d80], eax
mov dword [0x427f1c], ebx
mov dword [0x4281bc], ebx
mov dword [0x4290d0], ebx
mov dword [0x42808c], esi
call fcn.004137d0
add esp, 8
test eax, eax
jne 0x40bbe2
or esi, 1
push esi
push 0x191
push edi
push 0x7d1
push ebp
call fcn.004062d0
add esp, 0x14
jmp 0x40c80b
push 0x5c
push edi
call fcn.004137d0
inc eax
mov edx, 0x428260
add esp, 8
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40bbf5
push ebx
push 0x80
push 3
push ebx
push ebx
push 0x80000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40bc3d
or esi, 3
push esi
push 0x192
push 0x428260
push 0x7d9
push ebp
call fcn.004062d0
add esp, 0x14
jmp 0x40c80b
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [0x428f28], eax
cmp eax, 0xffffffff
jne 0x40bc77
or esi, 3
push esi
push 0x193
push 0x428260
push 0x7da
push ebp
call fcn.004062d0
add esp, 0x14
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c80b
add eax, 0x9c4000
push eax
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x428374], eax
cmp eax, ebx
jne 0x40bc9f
or esi, 2
push esi
push 0x194
push ebx
push 0x7d8
jmp 0x40bc62
mov ecx, dword [0x428f28]
add ecx, 0x9c4000
push eax
mov dword [0x428fac], ecx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [0x4290cc], eax
cmp eax, ebx
jne 0x40bcd2
or esi, 2
push esi
push 0x195
push ebx
push 0x7d6
jmp 0x40bc62
mov ecx, dword [0x428f28]
push ebx
lea edx, [esp + 0x24]
push edx
push ecx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40bd2c
or esi, 3
push esi
push 0x196
push 0x428260
push 0x7db
push ebp
call fcn.004062d0
mov edx, dword [0x428374]
add esp, 0x14
push edx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [0x428374]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40c80b
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x4290cc]
cmp byte [eax], 0x4d
jne 0x40c7d6
cmp byte [eax + 1], 0x5a
jne 0x40c7d6
mov ebx, dword [0x428f28]
cmp dword [eax + 0x3c], ebx
jbe 0x40bd6e
or esi, 1
push esi
push 0x198
push 0x428260
push 0x7d3
jmp 0x40c7e9
mov edi, dword [eax + 0x3c]
add edi, eax
mov dword [0x429208], edi
cmp byte [edi], 0x50
jne 0x40c7c1
cmp byte [edi + 1], 0x45
jne 0x40c7c1
cmp byte [edi + 2], 0
jne 0x40c7c1
cmp byte [edi + 3], 0
jne 0x40c7c1
test byte [edi + 0x17], 0x20
je 0x40bdbe
or esi, 1
push esi
push 0x19a
push 0x428260
push 0x7dc
jmp 0x40c7e9
push ebx
push str.Ng_VkcNv_O
push eax
call fcn.00402ef0
add esp, 0xc
cmp eax, 0xffffffff
je 0x40bdea
or esi, 1
push esi
push 0x19b
push 0x428260
push 0x7dd
jmp 0x40c7e9
lea edx, [edi + 4]
add edi, 0x18
mov dword [0x429d8c], edx
mov dword [0x429d84], edi
movzx eax, word [edx + 0x10]
add eax, edi
mov dword [0x4292e4], eax
movzx ecx, word [edx + 2]
xor ebp, ebp
test ecx, ecx
jle 0x40be27
add eax, 0x14
mov edi, dword [eax]
cmp edi, ebp
jb 0x40be1f
mov ebp, dword [eax - 4]
add ebp, edi
add eax, 0x28
sub ecx, 1
jne 0x40be14
xor eax, eax
mov dword [esp + 0x28], eax
mov dword [0x429200], eax
cmp ebp, ebx
jae 0x40bf60
push 0x427f80
sub ebx, ebp
push 0x101
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov eax, 0x427f80
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x40be56
mov ecx, dword [str.CM_tempfile]
mov edx, dword [0x423154]
push 0
push 0x80
push 2
push 0
mov dword [eax], ecx
mov ecx, dword [0x423158]
push 0
mov dword [eax + 4], edx
mov dl, byte [0x42315c]
push 0xc0000000
mov dword [eax + 8], ecx
push 0x427f80
mov byte [eax + 0xc], dl
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40bebf
mov eax, dword [esp + 0x10]
or esi, 2
push esi
push 0x1be
push 0
push 0x7df
push eax
jmp 0x40c7ea
mov edx, dword [0x4290cc]
mov ebx, dword [esp + 0x18]
push 0
lea ecx, [esp + 0x20]
push ecx
push ebx
add edx, ebp
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x1c], ebx
je 0x40befb
mov eax, dword [esp + 0x10]
or esi, 2
push esi
push 0x1bf
push 0
push 0x7e0
push eax
jmp 0x40c7ea
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x428f28]
mov ecx, dword [0x4290cc]
cmp byte [ecx + eax - 8], 0x48
mov edx, 1
mov dword [esp + 0x28], edx
jne 0x40bf5a
cmp byte [ecx + eax - 7], 0x54
jne 0x40bf5a
cmp byte [ecx + eax - 6], 0x4d
jne 0x40bf5a
cmp byte [ecx + eax - 5], 0x4c
jne 0x40bf5a
cmp byte [ecx + eax - 4], 0x32
jne 0x40bf5a
cmp byte [ecx + eax - 3], 0x41
jne 0x40bf5a
cmp byte [ecx + eax - 2], 0x50
jne 0x40bf5a
cmp byte [ecx + eax - 1], 0x50
jne 0x40bf5a
mov dword [0x429200], edx
mov dword [0x428f28], ebp
mov edx, dword [0x429d8c]
or ebx, 0xffffffff
xor ecx, ecx
mov dword [0x428250], ebx
xor eax, eax
cmp cx, word [edx + 2]
jae 0x40bfa3
mov edi, dword [0x4292e4]
add edi, 0x14
lea esp, [esp]
mov ecx, dword [edi]
cmp ecx, ebx
jae 0x40bf97
test ecx, ecx
jbe 0x40bf97
mov ebx, ecx
mov dword [0x428250], ebx
mov dword [0x4281bc], eax
movzx ecx, word [edx + 2]
inc eax
add edi, 0x28
cmp eax, ecx
jl 0x40bf80
movzx eax, word [edx + 2]
lea edx, [eax + eax*4]
mov eax, dword [esp + 0x24]
add edx, edx
add edx, edx
add edx, edx
sub edx, dword [0x4290cc]
push 0x429218
add edx, dword [0x4292e4]
push 0x429274
push 0x429220
push eax
mov dword [0x428088], edx
call fcn.00404ff0
test eax, eax
je 0x40c021
push eax
lea ecx, [esp + 0x34]
push 0x4230dc
push ecx
call fcn.0041246c
mov eax, dword [esp + 0x1c]
or esi, 1
push esi
push 0x19e
lea edx, [esp + 0x44]
push edx
push 0x7d5
push eax
call fcn.004062d0
mov edx, dword [0x429274]
add esp, 0x20
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40c7f2
mov ecx, dword [0x429274]
cmp byte [ecx], 0x4d
jne 0x40c798
cmp byte [ecx + 1], 0x5a
jne 0x40c798
mov eax, dword [ecx + 0x3c]
add eax, ecx
mov dword [0x427f24], eax
cmp byte [eax], 0x50
jne 0x40c784
cmp byte [eax + 1], 0x45
jne 0x40c784
cmp byte [eax + 2], 0
jne 0x40c784
cmp byte [eax + 3], 0
jne 0x40c784
mov edx, dword [0x428250]
sub edx, dword [0x428088]
lea ecx, [eax + 4]
add eax, 0x18
mov dword [0x428084], ecx
mov dword [0x4281d0], eax
movzx ecx, word [ecx + 0x10]
add ecx, eax
mov dword [0x4281b0], ecx
cmp edx, 0x78
jae 0x40c0b6
mov eax, dword [0x4281bc]
mov ecx, dword [esp + 0x10]
push 0x78
push eax
push ecx
call fcn.00406d00
add esp, 0xc
test eax, eax
je 0x40c7b2
mov ebp, dword [0x429d8c]
mov ebx, dword [0x427f1c]
xor edx, edx
xor edi, edi
cmp dx, word [ebp + 2]
jae 0x40c102
mov ecx, dword [0x4292e4]
add ecx, 0x10
mov edx, dword [ecx - 8]
mov eax, dword [ecx]
cmp edx, eax
jae 0x40c0e0
mov edx, eax
mov eax, dword [ecx - 4]
add eax, edx
mov dword [0x427f18], eax
cmp eax, ebx
jbe 0x40c0f6
mov ebx, eax
mov dword [0x427f1c], ebx
movzx eax, word [ebp + 2]
inc edi
add ecx, 0x28
cmp edi, eax
jl 0x40c0d5
mov edi, dword [0x429d84]
mov ecx, dword [edi + 0x20]
lea eax, [ecx + ebx - 1]
xor edx, edx
div ecx
mov ebp, dword [esp + 0x10]
xor ebx, ebx
push ebx
push ebp
mov dword [0x427f1c], eax
mov ecx, dword [edi + 0x20]
imul ecx, eax
mov dword [0x427f1c], ecx
call fcn.00406590
add esp, 8
test eax, eax
je 0x40c7b2
push 2
push ebp
call fcn.00406590
add esp, 8
test eax, eax
je 0x40c7b2
movzx eax, word [0x427f20]
lea edx, [eax + eax*4]
mov eax, dword [0x4292e4]
mov edi, dword [eax + edx*8 + 0x14]
add edi, dword [0x4290cc]
push 0x3e8
push str.Ng_VkcNv_O
push edi
mov dword [0x428fa8], edi
call fcn.00402ef0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40c198
push esi
push 0x1a4
push ebx
push 0x7d6
push ebp
jmp 0x40c7aa
mov edx, dword [0x429210]
lea eax, [edi + eax + 0xa]
mov dword [0x429214], eax
add eax, 0xfffffe74
mov dword [0x4290c4], eax
mov ecx, dword [eax]
add ecx, eax
mov dword [0x4290c8], ecx
cmp edx, dword [eax + 0x2f6]
jge 0x40c20d
mov eax, dword [eax + 0x2f6]
cdq
mov ecx, 0xa
idiv ecx
push edx
push eax
lea edx, [esp + 0x38]
push str._d._d
push edx
call fcn.0041246c
or esi, 1
push esi
push 0x1bd
lea eax, [esp + 0x48]
push eax
push 0x52
push ebp
call fcn.004062d0
mov edx, dword [0x429274]
add esp, 0x24
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40c7f2
mov ecx, dword [esp + 0x24]
lea edx, [eax + 0x1c5]
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x40c217
mov edx, dword [0x4290c4]
mov ecx, dword [esp + 0xa8]
add edx, 0x1cc
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x40c234
mov ecx, dword [esp + 0x14]
push 0x5c
push ecx
call fcn.004137d0
mov edx, dword [0x4290c4]
add esp, 8
inc eax
add edx, 0x1dd
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx], cl
inc eax
inc edx
test cl, cl
jne 0x40c260
mov ecx, dword [0x4290c4]
mov edx, dword [0x4290c8]
add ecx, 0x1c5
add edx, 4
nop
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x40c280
mov ecx, dword [0x4290c4]
mov edx, dword [0x4290c8]
add ecx, 0x1cc
add edx, 0xb
nop
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x40c2a0
mov ecx, dword [0x4290c4]
mov edx, dword [0x4290c8]
add ecx, 0x1dd
add edx, 0x1c
nop
mov al, byte [ecx]
mov byte [edx], al
inc ecx
inc edx
test al, al
jne 0x40c2c0
mov eax, dword [0x4290c4]
or dword [eax + 0x14], 0x20
cmp dword [0x42745c], ebx
je 0x40c2e7
mov eax, dword [0x4290c4]
or dword [eax + 0x14], 0x4000000
mov eax, dword [0x429d84]
mov edx, dword [eax + 0x1c]
add edx, dword [eax + 0x10]
mov eax, dword [0x429214]
mov dword [eax], edx
mov ecx, dword [0x4281d0]
mov edx, dword [ecx + 0x10]
sub edx, dword [0x429300]
mov eax, dword [0x429d84]
add edx, dword [0x429304]
push ebp
mov dword [eax + 0x10], edx
mov ecx, dword [0x429d84]
mov edx, dword [ecx + 0x1c]
mov eax, dword [0x429214]
mov dword [eax + 4], edx
mov ecx, dword [0x429d84]
mov edx, dword [ecx + 0x68]
mov eax, dword [0x429214]
mov dword [eax + 8], edx
mov ecx, dword [0x429d84]
mov edx, dword [ecx + 0x6c]
mov eax, dword [0x429214]
mov dword [eax + 0xc], edx
mov ecx, dword [0x429d84]
mov edx, dword [ecx + 0x88]
mov eax, dword [0x429214]
mov dword [eax + 0x14], edx
mov ecx, dword [0x429d84]
mov edx, dword [ecx + 0x8c]
mov eax, dword [0x429214]
mov dword [eax + 0x18], edx
mov ecx, dword [0x429d8c]
movzx eax, word [ecx + 2]
lea edx, [eax + eax*4]
mov eax, dword [0x4292e4]
mov ecx, dword [eax + edx*8 - 0x1c]
mov edx, dword [0x429214]
mov dword [edx + 0x10], ecx
mov eax, dword [0x429214]
mov dl, byte [esp + 0xb8]
mov dword [eax + 0x28], 0x7fffffff
mov ecx, dword [0x429214]
mov eax, dword [esp + 0xbc]
mov byte [ecx + 0x2c], dl
mov ecx, dword [0x429214]
mov dword [ecx + 0x31], eax
mov edx, dword [0x429d84]
mov dword [edx + 0xbc], ebx
mov eax, dword [0x429d84]
mov dword [eax + 0xb8], ebx
mov ecx, dword [0x429d84]
mov dword [ecx + 0xc4], ebx
mov edx, dword [0x429d84]
mov dword [edx + 0xc0], ebx
call fcn.00406b50
add esp, 4
test eax, eax
je 0x40c7b2
push ebp
call fcn.00406890
add esp, 4
test eax, eax
je 0x40c7b2
mov eax, dword [0x429d84]
mov dword [eax + 0x94], ebx
mov ecx, dword [0x429d84]
mov dword [ecx + 0x90], ebx
mov edx, dword [0x429d84]
mov dword [edx + 0xb4], ebx
mov eax, dword [0x429d84]
mov dword [eax + 0xb0], ebx
mov eax, dword [0x429d84]
mov ecx, 0xfeff
and word [eax + 0x46], cx
mov eax, dword [0x429d84]
mov edx, 0xffbf
and word [eax + 0x46], dx
mov eax, dword [0x429d84]
mov ecx, 0xfbff
and word [eax + 0x46], cx
movzx eax, word [0x427f20]
lea edx, [eax + eax*4]
mov eax, dword [0x4292e4]
mov eax, dword [eax + edx*8 + 0x14]
add eax, dword [0x4290cc]
push 0x3e8
push str.Ng_VkcNv_O
push eax
mov dword [0x428fa8], eax
call fcn.00402ef0
mov edi, eax
add esp, 0xc
cmp edi, 0xffffffff
jne 0x40c4af
push esi
push 0x1a5
push ebx
push 0x7d6
push ebp
jmp 0x40c7aa
mov eax, dword [0x429274]
cmp eax, ebx
je 0x40c4c1
push eax
call fcn.0041232a
add esp, 4
push ebp
call fcn.00407330
add esp, 4
test eax, eax
je 0x40c80b
mov eax, dword [0x4281c8]
shr eax, 0x11
mov ecx, 1
mov dword [0x4290d0], ecx
cmp eax, ebx
jbe 0x40c4fc
lea esp, [esp]
add ecx, ecx
shr eax, 1
jne 0x40c4f0
mov dword [0x4290d0], ecx
mov edx, dword [0x428fa8]
lea eax, [edx + edi + 0xa]
mov dword [0x429214], eax
mov dword [eax + 0x2d], ecx
mov eax, dword [0x429214]
add eax, 0xfffffe74
push esi
push ebp
mov dword [0x4290c4], eax
call fcn.00406f50
add esp, 8
test eax, eax
je 0x40c7f2
mov eax, dword [0x429214]
add eax, 0xfffffe74
push eax
mov dword [0x4290c4], eax
call fcn.00404b20
mov ecx, dword [0x429d8c]
movzx eax, word [ecx + 2]
mov ebp, dword [esp + 0x18]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
add esp, 4
push 0
lea edx, [eax + eax*4]
mov eax, dword [0x429d84]
add edx, edx
push 0x80
add edx, edx
push 2
add edx, edx
sub edx, dword [0x4290cc]
push 0
add edx, dword [0x4292e4]
push 0
push 0xc0000000
push ebp
mov dword [eax + 0x3c], edx
call ebx
mov edi, eax
cmp edi, 0xffffffff
jne 0x40c5b5
mov ecx, dword [esp + 0x10]
or esi, 3
push esi
push 0x1a8
push ebp
push 0x7d9
push ecx
call fcn.004062d0
add esp, 0x14
jmp 0x40c80b
mov eax, dword [0x428f28]
mov ecx, dword [0x4290cc]
push 0
lea edx, [esp + 0x24]
push edx
push eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40c5f5
mov edx, dword [esp + 0x10]
or esi, 3
push esi
push 0x1a9
push ebp
push 0x7d7
push edx
call fcn.004062d0
add esp, 0x14
jmp 0x40c80b
cmp dword [esp + 0x28], 0
je 0x40c6d8
push 0x2800
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x428258], eax
test eax, eax
jne 0x40c62f
or esi, 2
push esi
push 0x1c0
push eax
mov eax, dword [esp + 0x1c]
push 0x7e1
push eax
jmp 0x40c7ea
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push 0x427f80
call ebx
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x40c669
mov ecx, dword [esp + 0x10]
or esi, 2
push esi
push 0x1be
push 0
push 0x7df
push ecx
jmp 0x40c7ea
mov eax, dword [esp + 0x18]
test eax, eax
jbe 0x40c6ba
lea edx, [eax - 1]
mov eax, 0xcccccccd
mul edx
mov ebx, edx
shr ebx, 0xd
inc ebx
mov ecx, dword [0x428258]
push 0
lea eax, [esp + 0x30]
push eax
push 0x2800
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x2c]
mov ecx, dword [0x428258]
push 0
lea edx, [esp + 0x20]
push edx
push eax
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
sub ebx, 1
jne 0x40c681
mov edx, dword [0x428258]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push ebp
call ebx
mov edi, eax
cmp edi, 0xffffffff
je 0x40c760
mov eax, dword [0x429d84]
sub eax, dword [0x4290cc]
push 0
push 0
add eax, 0x40
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40c759
mov edx, dword [0x429d84]
push 0
lea ecx, [esp + 0x24]
push ecx
push 4
add edx, 0x40
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40c759
mov eax, dword [esp + 0x10]
or esi, 3
push esi
push 0x1ac
push ebp
push 0x7d7
push eax
call fcn.004062d0
add esp, 0x14
jmp 0x40c80b
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x428374]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [0x428374]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 1
jmp 0x40c80d
mov eax, dword [esp + 0x10]
push esi
push 0x1a3
push 0
push 0x7d6
push eax
jmp 0x40c7aa
mov ecx, dword [esp + 0x10]
push esi
push 0x1a2
push 0
push 0x7d6
push ecx
call fcn.004062d0
add esp, 0x14
mov edx, dword [0x429274]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x40c7f2
or esi, 1
push esi
push 0x199
push 0x428260
push 0x7d4
jmp 0x40c7e9
or esi, 1
push esi
push 0x197
push 0x428260
push 0x7d2
push ebp
call fcn.004062d0
add esp, 0x14
mov eax, dword [0x428374]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov ecx, dword [0x428374]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
mov ecx, dword [esp + 0x94]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00411e16
add esp, 0x88
ret